import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Register from '../views/Register.vue'
import Shopping from '../views/Shopping.vue'
import Orders from '../views/Order/Orders.vue'
import Mine from '../views/Mine.vue'
import Main from '../views/Main.vue'
import Login from '../views/Login.vue'
import AddAddress from '../views/adress/AddAddress.vue'
import EditAddress from '../views/adress/EditAddress.vue'
import Address from '../views/adress/Address.vue'
import Product from '../views/product/Product.vue'
import Delproduct from '../views/product/Delproduct.vue'
import ComOrders from '../views/Order/ComOrders.vue'
import ShadeProduct from '../views/product/ShadeProduct.vue'
import PayOrder from '../views/Order/PayOrder.vue'
import SuccessOrder from '../views/Order/SuccessOrder.vue'
import Search from '../views/search/Search.vue'
import SearchList from '../views/search/SearchList.vue'
Vue.use(VueRouter)

const routes = [{
		path: '/',
		redirect: '/searchlist'
	},{
		path:'/comorders',
		component:ComOrders
	},{
		path:'/search',
		component:Search
	},{
		path:'/searchlist',
		component:SearchList
	},{
		path:'/payorder',
		component:PayOrder
	},{
		path:'/successorder',
		component:SuccessOrder
	},{
		path:'/address',
		component:Address
	},{
		path:'/delproduct',
		component:Delproduct
	},{
		path:'/product',
		component:Product
	},{
		path:'/shadeproduct',
		component:ShadeProduct
	},
	{
		path: '/login',
		component: Login
	},
	{
		path:'/addaddress',
		component:AddAddress
	},
	{
		path:'/editaddress',
		component:EditAddress
	},
	{
		path: '/register',
		component: Register
	}, {
		path: '/home',

		component: Home,
		children: [{
				path: '/home',
				name: 'Main',
				component: Main,
				children:[{
					path:'/address',
					component:Address
				}]
			},
			{
				path: '/home/shopping',
				component: Shopping
			}, {
				path: '/home/orders',
				component: Orders
			}, {
				path: '/home/mine',
				component: Mine
			}
		]
	}
]

const router = new VueRouter({
	routes
})

export default router
